<?php defined('SEJUJOPEFDNGJSL') or exit('Access denied');?>

<?php
//取得文章
$arrn=getnews();
//头条
$rn=$arrn[0];
//
$rns=$arrn[1];
// fun_sj($_userid);//动态等级
// fun_jj($_userid);//晋级等级
// givepresentcoin();
?>
<div style="clear:both;"></div>
<?php require("topbut.php");


?>
<style>
	 @media screen and (min-width: 320px) and (max-width: 480px) {
        .span_n2{display: block;}
    }
</style>
<div class="mylink alert" style="padding:5px;min-height:105px;background:rgba(134,195,65, .5);border:1px solid rgba(134,195,65, 1);display:none;">
	<div class="shaidan">
		<div class="sd_content">
			<div class="hd">
				<a class="next"></a>
				<a class="prev"></a>
			</div>
			<div class="row">
				<?php
				foreach ($rns as $k => $v) {
				?>
					<div class="col-md-6" style="line-height: 30px;">
						<span style="font-size: 14px;color: #777;margin-right:5px;"><?php echo date("Y-m-d",$v['art_time']); ?></span>
						<a href="<?php echo SITEINDEX.'?lsact=newsview&veid='.$v['id']?>" style="color: #666;"><?php echo $v['title'];?></a>
					</div>
				<?php
				}
				?>
			</div>
			<!-- <div class="bd">
				<ul style="float: left;">
				<?php
				foreach ($rns as $k => $v) {
				?>
					<li class="bg-success"><a href="<?php echo SITEINDEX.'?lsact=newsview&veid='.$v['id']?>"><?php echo $v['title'];?></a><span class="newdate"><?php echo date("Y-m-d",$v['art_time']); ?></span></li>
				<?php
				}
				?>
				</ul>
			</div> -->
		</div>
		<script type="text/javascript">
			// jQuery(".sd_content").slide({titCell:".hd ul",mainCell:".bd ul",autoPage:true,effect:"top",autoPlay:true,interTime:3000,vis:4});
		</script>
	</div>
</div>
<div class="row">
    <div class="col-md-5 col-md-offset-4">
        <p style="color:#6863ff;font-size: 17px;">
            钱包地址 : <?php print($r['vic_address']); ?>
        </p>

    </div>
</div>
<div class="row">
	<!-- begin col-3 -->
	<div class="col-md-4 col-sm-6">
		<div class="widget widget-state" style="background:#00aac4;">
			<div class="state-icon"><i class="glyphicon glyphicon-gift"></i></div>
			<div class="state-info">
				<h4>VIC</h4>
				<p><span style="font-size: 13px;font-weight: normal;">可用数量：</span><?php echo sprintf("%.4f",$r['cash_purse']); ?></p>
				<p><span style="font-size: 13px;font-weight: normal;">锁仓数量：</span><?php echo sprintf("%.4f",$r['freeze_benjin']+$r['presentcoin']); ?></p>
			</div>
		</div>
	</div>
<!--
<div class="col-md-3 col-sm-6">
		<div class="widget widget-state" style="background:#dd1c21;">
			<div class="state-icon"><i class="glyphicon glyphicon-usd"></i></div>
			<div class="state-info">
				<h4>赠送赞币</h4>
				<p><?php echo round($r['presentcoin'],2); ?></p>
			</div>
		</div>
	</div>
-->
	<!-- end col-3 -->
	<!-- begin col-3 -->
	<div class="col-md-4 col-sm-6">
		<div class="widget widget-state" style="background:#B8D200;">
			<div class="state-icon"><i class="glyphicon glyphicon-lock"></i></div>
			<div class="state-info">
				<h4>锁仓收益</h4>
				<p><span style="font-size: 13px;font-weight: normal;">可用数量：</span><?php echo sprintf("%.4f",$r['lixi_crash']); ?></p>
				<p><span style="font-size: 13px;font-weight: normal;">锁仓数量：</span><?php echo sprintf("%.4f",$r['freeze_lixi']); ?></p>
			</div>
		</div>
	</div>
	<!-- end col-3 -->
	<!-- begin col-3 -->
	<div class="col-md-4 col-sm-6">
		<div class="widget widget-state" style="background:#FF9800;">
			<div class="state-icon"><i class="glyphicon glyphicon-briefcase"></i></div>
			<div class="state-info">
				<h4>团队收益</h4>
				<p style="width:85%;"><span class="span_n2"><span style="font-size: 13px;font-weight: normal;">可用数量：</span><?php echo sprintf("%.4f",$r['keyong_ldprize']); ?></span> <span style="font-size: 13px;font-weight: normal;"><!--冻结数量：</span><?php //echo sprintf("%.4f",$r['cash_ldprize']); ?>--></p>
				<!-- <p><span style="font-size: 13px;font-weight: normal;">冻结数量：</span><?php echo sprintf("%.4f",$r['cash_ldprize']); ?></p> -->
				<p style="display: inline;"><span style="font-size: 13px;font-weight: normal;">锁仓数量：</span><?php echo sprintf("%.4f",$r['freeze_ldj']); ?></p>
			</div>
		</div>
	</div>
	<!-- end col-3 -->

</div>
<div class="row">

	<!-- begin col-3 -->
	<!-- <div class="col-md-3 col-sm-6">
		<div class="widget widget-state" style="background:#3498db;">
			<div class="state-icon"><i class="glyphicon glyphicon-list-alt"></i></div>
			<div class="state-info">
				<h4>赠送积分</h4>
				<p><?php //echo round($r['fuxiao_crash'],2)+round($r['fuxiao_jin'],2); ?></p>
			</div>
		</div>
	</div> -->
	<!-- end col-3 -->
	<!-- begin col-3 -->
	<!-- <div class="col-md-3 col-sm-6">
		<div class="widget widget-state" style="background:#86c341;">
			<div class="state-icon"><i class="glyphicon glyphicon-road"></i></div>
			<div class="state-info">
				<h4>岗位积分</h4>
				<p><?php //echo round($r['rise_crash'],2); ?></p>
			</div>
		</div>
	</div> -->
	<!-- end col-3 -->
	<!-- begin col-3 -->
	<!-- <div class="col-md-3 col-sm-6">
		<div class="widget widget-state" style="background:#00aac4;">
			<div class="state-icon"><i class="glyphicon glyphicon-credit-card"></i></div>
			<div class="state-info">
				<h4>共享积分</h4>
				<p><?php //echo round($r['point_crash'],2); ?></p>
			</div>
		</div>
	</div> -->
	<!-- end col-3 -->
	<!-- begin col-3 -->
	<!-- <div class="col-md-3 col-sm-6">
		<div class="widget widget-state" style="background:#dd1c21;">
			<div class="state-icon"><i class="glyphicon glyphicon-user"></i></div>
			<div class="state-info">
				<h4>销售业绩</h4>
				<p><?php //echo round($r['team_tot'],2);?></p>
			</div>
		</div>
	</div> -->
	<!-- end col-3 -->
</div>
<!-- 个人信息余额 -->
<!-- <div class="row perifo">
	<div class="col-md-6">
		<div class="cwcommon">
			<div class="petop"><img src="theme/images/myicon2.png">我的账户</div>
			<div class="cwc_inner">
				<div class="cwc_box">
					<div class="cwc_box_left">
						<span class="badge badge-default" style="background: #ff5b57;">1</span> 账号
					</div>
					<div class="cwc_box_right">
						<?php //echo $r['uname']; ?>
					</div>
				</div>
				<div class="cwc_box graybg">
					<div class="cwc_box_left">
						<span class="badge badge-default" style="background: #f59c1a;">2</span> 昵称
					</div>
					<div class="cwc_box_right">
						<?php //echo $r['nick_name']; ?>
					</div>
				</div>
				<div class="cwc_box">
					<div class="cwc_box_left">
						<span class="badge badge-default" style="background: #00acac;">3</span> 级别
					</div>
					<div class="cwc_box_right">
						<?php //echo getlevel($r["user_level"])?>
					</div>
				</div>
				<a href="<?php //echo SITEINDEX ?>?lsact=myinfo">
					<div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background: #2d353c;">4</span> 个人资料
						</div>
						<div class="cwc_box_right">
							修改个人资料
						</div>
					</div>
				</a>
				<div class="cwc_box">
					<div class="cwc_box_left">
						<span class="badge badge-default" style="background: #ff5b57;">5</span> 开户姓名
					</div>
					<?php
					$jinji="";
	                if($r['user_jjlever']==1){
	                	$jinji="<img src='theme/images/level1.png'  width=23px'>";
	                }
	                if($r['user_jjlever']==2){
	                	$jinji="<img src='theme/images/level2.png'  width=23px'>";
	                }
	                if($r['user_jjlever']==3){
	                	$jinji="<img src='theme/images/level3.png'  width=23px'>";
	                }
					?>
					<div class="cwc_box_right">
						<?php echo $r['real_name']." ".$jinji; ?>
					</div>
				</div>
				<a href="<?php echo SITEINDEX?>?lsact=zhuanlist">
					<div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background: #f59c1a;">6</span> 激活码
						</div>
						<div class="cwc_box_right">
							<?php echo round($r['active_coin'],2); ?>
						</div>
					</div>
				</a>
				<div class="cwc_box">
					<div class="cwc_box_left">
						<span class="badge badge-default" style="background: #2d353c;">7</span> 我的推广链接
					</div>
					<div class="cwc_box_right" style="min-height: 60px;">
						<?php echo YUMING;?>r1.php?tid=<?php echo $r['uname']?>
					</div>
				</div>
		   	</div>
		</div>
	</div>
	<div class="col-md-12">
		<div class="cwcommon">
			<div class="petop"><img src="theme/images/myicon2.png">我的钱包</div>
		   	<div class="shaidan">
				<div class="sd_content">
					<div class="hd">
						<a class="next"></a>
						<a class="prev"></a>
					</div>
					<div class="bd">
						<ul>
						<?php
						//foreach ($rns as $k => $v) {
						?>
							<li class="bg-success"><a href="<?php //echo SITEINDEX.'?lsact=newsview&veid='.$v['id']?>"><?php echo $v['title'];?></a><span class="newdate"><?php //echo date("Y-m-d",$v['art_time']); ?></span></li>
						<?php
						//}
						?>
						</ul>
					</div>
				</div>
			</div>
			<div class="cwc_inner">
				<a href="<?php //echo SITEINDEX?>?lsact=zhuanlist">
					<div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background: #2d353c;">1</span> 锁仓劵
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['give_help_coin'],2); ?>
						</div>
					</div>
				</a>
				<a href="<?php //echo SITEINDEX?>?lsact=shouyi">
					<div class="cwc_box">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background:#f59c1a;">2</span> 商品积分
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['cash_purse'],2); ?>
						</div>
					</div>
				</a>
				<a href="<?php //echo SITEINDEX?>?lsact=prizelist">
					<div class="cwc_box">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background: #00acac;">3</span> 分享积分
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['cash_ldprize'],2); ?>
						</div>
					</div>
				</a>
				<a href="<?php //echo SITEINDEX?>?lsact=shouyi">
					<div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background:#FF83FA;">4</span> 奖励积分
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['lixi_crash'],2); ?>
						</div>
					</div>
                </a>
                <div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background:#00CD00;">5</span> 赠送积分包
						</div>
						<div class="cwc_box_right" >
							<?php //echo round($r['fuxiao_crash'],2); ?>
						</div>
					</div>
				    <div class="cwc_box graybg">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background:#CDC1C5;">6</span> 岗位积分包
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['rise_crash'],2); ?>
						</div>
					</div>
					<div class="cwc_box">
						<div class="cwc_box_left">
							<span class="badge badge-default" style="background:#00FA9A;">7</span> 商城积分包
						</div>
						<div class="cwc_box_right">
							<?php //echo round($r['point_crash'],2); ?>
						</div>
					</div>
		   	</div>
		</div>
	</div>
</div> -->
<!-- 个人信息余额结束 -->
<div style="clear:both"></div>
<div class="indexgiveh">
	<div class="givehtit"><img src="theme/images/buticon1.png">锁仓记录</div>
	<div class="table-responsive">
		<table border="0" cellpadding="0" cellspacing="0" style="margin:0 auto;margin-top:20px;width:97%;" class="table table-striped givetable" align="center" >
		  <tbody>
			<tr>
				<th width="8%">序号</th>
				<!--<th valign="middle" width="10%">订单编号</th>-->

				<th valign="middle" width="10%">锁仓类型</th>
				<th valign="middle" width="8%">套餐</th>
				<th valign="middle" width="8%">锁仓数量</th>
				<th valign="middle" width="8%">预计收益</th>
				<th valign="middle" width="10%">实际收益</th>
				<th valign="middle" width="15%">锁仓时间</th>
				<th valign="middle" width="15%">到期时间</th>
				<th valign="middle" width="14%">状态</th>
				<!-- <th valign="middle" width="8%">操作</th> -->
			</tr>
		<?php
		$pagecount=10;   //每页条数
		$condition=" where  a.uid=$_userid"; //session 中读取出来的登陆者的id
		$psql="select count(0) from ld_lock_log as a $condition";
		$db->query($psql,3);
		$pcount=$db->fval;
		$pagecount=$pagecount;   //每页条数
		$astr="&lsact=cunkuan&templist=1";    //Url
		$pagearr=pagelist($pagecount,$pcount,$astr);
		$offset=$pagearr[1];

		$sql="select a.*,(case when a.type=1 then 'VIC' when a.type = 2 then '锁仓收益' when a.type = 3 then '团队收益' else 'VIC利息动态' end) as types,(case when a.status=0 then '锁仓中' when a.status =1 then '已完成' when a.status =2 then '已取消' else '未知' end) as statuss,b.title,b.meal,b.days from ld_lock_log as a left join ld_set_meal as b on a.pid = b.id  $condition order by a.id desc limit $offset,$pagecount";
		$db->query($sql);
		$rs=$db->rs;
		$ii=0;
		foreach ($rs as $k => $v) {
		  $ii++;
		  $serialid=($pagearr[2]-1)*$pagecount+$ii;

		?>
		<?php if($ii<11){ ?>
			<tr>
				<td align="center"><?php echo $ii; ?></td>
				<td align="center"><?php echo $v['types']?></td>
				<td><?php echo $v['title']; ?></td>
				<td align="center"><?php echo ($v['nums'])?></td>
				<td align="center">
					<?php print('日息'.($v['meal']*100).'%'); ?></td>
				<td align="center">
					<?php print($v['mum']); ?></td>
				<td align="center"><?php print(date('Y-m-d H:i:s',$v['add_time']));?></td>
				<td><?php print(date('Y-m-d H:i:s',$v['end_date'])); ?></td>
				<td align="center">
					<?php print($v['statuss']); ?>
				</td>
			</tr>
		<?php } ?>
		<?php
		}
		?>
		  </tbody>
		</table>
	</div>
	<?php if($ii>3){ ?>
		<div id="hideck">查看所有记录</div>
	<?php } ?>
</div>

<style type="text/css">
	.annou{left: 0px!important;}
	.annou .layui-layer-btn{text-align: center;height: 35px;line-height: 35px;font-size: 16px;position: absolute;left: 0px;bottom: 30px;z-index: 999;width: 100%;}
    .layui-layer-btn a{height: 35px;line-height: 35px;padding:0 25px;}
    .annou .layui-layer-btn .layui-layer-btn0{opacity: 0.8;}
</style>
<script type="text/javascript">
$("#hideck").click(function(){
	if($(this).html()=='查看所有记录'){
		location.href='/home.php?lsact=shouyi';
		// $(this).html("隐藏记录");
	}else{
		if($(this).html()=='隐藏记录'){
			$(this).html("查看所有记录");
		}
	}
});
$("#hideck").click(function(){
	$(".hiddenck").toggle();
});
$("#hideqk").click(function(){
	if($(this).html()=='查看所有记录'){
		$(this).html("隐藏记录");
	}else{
		if($(this).html()=='隐藏记录'){
			$(this).html("查看所有记录");
		}
	}
});
$("#hideqk").click(function(){
	$(".hiddenqk").toggle();
});
$(document).ready(function(){
	if(document.cookie.length>0 && document.cookie.indexOf("dialogshow") != -1){
		return false;
	}else{

		// var index = layer.open({
		// 	type: 2,
		// 	content: "<?php echo YUMING ?>announce.html",
		// 	area: ['100%', '100%'],
		// 	skin:"annou",
		// 	maxmin: true,
		// 	closeBtn:0,
		// 	title:false,
		// 	maxmin:false,
		// 	btn: ['开启凯莎国际'],
		// 	yes: function(index, layero){
		// 		document.cookie  = 'dialogshow=false';
		// 		layer.close(index);
		// 	},
		// 	success: function(){
		// 		alert("请点击同意协议方能继续");
		// 	}
		// });
		// layer.full(index);
		// return false;

	}
});
function chuchang(id){
	if(id<1){
		layer.alert('该锁仓订单有误！');
		return;
	}
	var index = layer.load(1, {shade: [0.3,'#8F8F8F']});
	$.ajax({
      type: "get",
      dataType: "json",
      url: "/ajax.php?act=chuchang&id="+id,
      success: function(data){
        if(data.status==0){
          layer.alert(data.tips, function(index){
              layer.closeAll();
          });

        }else{
          layer.alert(data.tips, function(index){
              window.location.href="home.php?lsact=index";
          });

        }

      },
      error: function(){
      	layer.alert('出错了', function(index){
              layer.closeAll();
          });

      },

      });


}
</script>
